{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-10-18T03:26:19.443714Z",
     "start_time": "2018-10-18T03:26:18.911765Z"
    },
    "collapsed": true,
    "hide_input": false
   },
   "outputs": [],
   "source": [
    "import torch\n",
    "import torch.nn as nn\n",
    "import torch.nn.functional as F\n",
    "from torch.autograd import Variable\n",
    "from torch.optim.lr_scheduler import StepLR\n",
    "from torch.utils.data import DataLoader,TensorDataset\n",
    "import torch.utils.data as data\n",
    "import numpy as np\n",
    "import scipy.io as sio\n",
    "import math\n",
    "import argparse\n",
    "import random\n",
    "import os\n",
    "from My_Loss import HardTripletLoss\n",
    "from My_Loss import HardTripletLoss2\n",
    "from My_Loss import HardTripletLoss_D\n",
    "from tensorboardX import SummaryWriter\n",
    "import visdom"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-10-18T03:26:19.447059Z",
     "start_time": "2018-10-18T03:26:19.444851Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "BATCH_SIZE = 64\n",
    "EPISODE = 100000\n",
    "TEST_EPISODE = 1000\n",
    "LEARNING_RATE =1e-3\n",
    "Weight_Deacy = 1e-6\n",
    "GPU = 0\n",
    "Margin = 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-10-18T03:26:21.452429Z",
     "start_time": "2018-10-18T03:26:19.448906Z"
    },
    "hide_input": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "init dataset\n",
      "----------------------------------------------------------------------------------------------------\n"
     ]
    }
   ],
   "source": [
    "print(\"init dataset\")\n",
    "##################################参数##################################################################\n",
    "dataroot = '../data'\n",
    "dataset = 'AwA1_data'\n",
    "image_embedding = 'res101'               #ResNet101层\n",
    "class_embedding = 'original_att'         #属性表达 85-d\n",
    "#######################################读取视觉特征###################################################################\n",
    "\n",
    "matcontent = sio.loadmat(dataroot + \"/\" + dataset + \"/\" + image_embedding + \".mat\")  #scipy loadmat\n",
    " \n",
    "feature = matcontent['features'].T         #转置 30478x2048 每一行是一个完整的样本\n",
    "\n",
    "label = matcontent['labels'].astype(int).squeeze() - 1   #matlab begin 1 ,numpy begin 0\n",
    "########################################读取属性特征###########################################################\n",
    "\n",
    "matcontent = sio.loadmat(dataroot + \"/\" + dataset + \"/\" + class_embedding + \"_splits.mat\")\n",
    "\n",
    "    \n",
    "# numpy array index starts from 0, matlab starts from 1\n",
    "trainval_loc = matcontent['trainval_loc'].squeeze() - 1    #squeeze()去掉维度中的1 AxBx1 --->AxB\n",
    "\n",
    "test_seen_loc = matcontent['test_seen_loc'].squeeze() - 1\n",
    "test_unseen_loc = matcontent['test_unseen_loc'].squeeze() - 1\n",
    "\n",
    "attribute = matcontent['att'].T    #转置 50x85 每行是整个属性向量\n",
    "\n",
    "x = feature[trainval_loc]                      # train_features trainval里面是图片的编号 begin with 0 ，19832个\n",
    "train_label = label[trainval_loc].astype(int)  # train_label  int类型没变 每个图片的lable 19832个\n",
    "train_id = np.unique(train_label)\n",
    "\n",
    "att = attribute[train_label]                   # train attributes 每个图片的属性 19832个\n",
    "\n",
    "    \n",
    "x_test = feature[test_unseen_loc]                   # test_feature 5685个\n",
    "test_label = label[test_unseen_loc].astype(int)     # test_label   5685个\n",
    "\n",
    "x_test_seen = feature[test_seen_loc]                #test_seen_feature 4958个\n",
    "test_label_seen = label[test_seen_loc].astype(int)  # test_seen_label  4958个\n",
    "    \n",
    "test_id = np.unique(test_label)                     # test_id  10个类 ，unique去重\n",
    "att_pro = attribute[test_id]                        # test_attribute 每一类的属性向量 10x85\n",
    "\n",
    "# train set\n",
    "train_features = torch.from_numpy(x)   #np-->tensor\n",
    "#train_fearures_negative = torch.from_numpy(x_negative)\n",
    "\n",
    "sample_attributes=[]\n",
    "train_label = torch.from_numpy(train_label).unsqueeze(1) #每张图片的属性转化 ，unsqueeze(1)就是插入到第一维度 AxB维-->Ax1xB\n",
    "# attributes\n",
    "all_attributes = np.array(attribute)  #所有50类属性转变为numpy数组???属性向量仍然用的numpy类型 没有转化为pytorch\n",
    "    \n",
    "#print('-'*50)\n",
    "attributes = torch.from_numpy(attribute) \n",
    "#print(attribute)\n",
    "# test set\n",
    "\n",
    "test_features = torch.from_numpy(x_test)\n",
    "#print(test_features.shape)\n",
    "\n",
    "test_label = torch.from_numpy(test_label).unsqueeze(1)\n",
    "#print(test_label.shape)\n",
    "\n",
    "testclasses_id = np.array(test_id)\n",
    "#print(testclasses_id.shape)\n",
    "\n",
    "test_attributes = torch.from_numpy(att_pro).float()\n",
    "#print(test_attributes.shape)\n",
    "\n",
    "test_seen_features = torch.from_numpy(x_test_seen)\n",
    "#print(test_seen_features.shape)\n",
    "\n",
    "test_seen_label = torch.from_numpy(test_label_seen)\n",
    "\n",
    "train_data = TensorDataset( train_label, train_features )\n",
    "#train_data = TensorDataset(train_label, train_features, train_fearures_negative)\n",
    "\n",
    "#################here need new code to make triplet data#####################\n",
    "print('-'*100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-10-18T03:26:21.455831Z",
     "start_time": "2018-10-18T03:26:21.453481Z"
    },
    "collapsed": true,
    "hide_input": true
   },
   "outputs": [],
   "source": [
    "from my_net_3 import AttributeNetwork\n",
    "from my_net_3 import MetricNetwork"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-10-18T03:26:23.464205Z",
     "start_time": "2018-10-18T03:26:21.456922Z"
    },
    "hide_input": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "init networks\n",
      "----------------------------------------------------------------------------------------------------\n"
     ]
    }
   ],
   "source": [
    "# init network\n",
    "print(\"init networks\")\n",
    "attribute_network = AttributeNetwork(85,1024,2048)  #85d属性 1024隐藏层 2048输出 85d到2048d\n",
    "metric_network = MetricNetwork(2048,1024,2048)\n",
    "\n",
    "attribute_network.cuda(GPU) \n",
    "metric_network.cuda(GPU)\n",
    "\n",
    "#学习率每200k步 乘0.5\n",
    "attribute_network_optim = torch.optim.SGD(attribute_network.parameters(), lr=LEARNING_RATE,weight_decay=Weight_Deacy,momentum=0.9 )\n",
    "metric_network_optim = torch.optim.SGD(metric_network.parameters(), lr=LEARNING_RATE,weight_decay=Weight_Deacy,momentum=0.9 )\n",
    "#\n",
    "#triplet_network_optim = torch.optim.SGD(triplet_network.parameters(), lr=LEARNING_RATE,momentum=0.9 , \n",
    "#                                         weight_decay=Weight_Deacy)\n",
    "\n",
    "attribute_network_scheduler = StepLR(attribute_network_optim , step_size=10000 , gamma=0.5)\n",
    "metric_network_scheduler = StepLR(metric_network_optim , step_size=10000 , gamma=0.5)\n",
    "#\n",
    "print('-'*100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-10-18T03:26:23.471667Z",
     "start_time": "2018-10-18T03:26:23.465402Z"
    },
    "collapsed": true,
    "hide_input": true
   },
   "outputs": [],
   "source": [
    "def compute_accuracy(test_features, test_label, test_id, test_attributes):\n",
    "    \n",
    "    test_data = TensorDataset(test_features, test_label)\n",
    "    test_batch = 32\n",
    "    test_loader = DataLoader(test_data, batch_size=test_batch, shuffle=False)\n",
    "    total_rewards = 0\n",
    "\n",
    "    sample_labels = test_id\n",
    "    sample_attributes = test_attributes\n",
    "    class_num = sample_attributes.shape[0]\n",
    "    test_size = test_features.shape[0]\n",
    "\n",
    "    print(\"class num:\", class_num)\n",
    "\n",
    "    for batch_features,batch_labels in test_loader:\n",
    "\n",
    "        batch_size = batch_labels.shape[0]\n",
    "        batch_features_ext = torch.from_numpy(batch_features.numpy().repeat(class_num, 0))\n",
    "        batch_features_ext = metric_network(Variable(batch_features_ext).cuda(GPU).float())  # 32*1024\n",
    "\n",
    "\n",
    "        sample_features = metric_network(attribute_network(Variable(sample_attributes).cuda(GPU).float()))\n",
    "        sample_features_ext = sample_features.repeat(batch_size, 1)\n",
    "\n",
    "\n",
    "        relations = F.pairwise_distance(batch_features_ext, sample_features_ext, 2).view(-1, class_num)\n",
    "        re_batch_labels = []\n",
    "        for label in batch_labels.numpy():\n",
    "            index = np.argwhere(sample_labels == label)\n",
    "            re_batch_labels.append(index[0][0])\n",
    "        re_batch_labels = torch.cuda.LongTensor(re_batch_labels)\n",
    "\n",
    "\n",
    "        _, predict_labels = torch.min(relations.data, 1)\n",
    "        rewards = [1 if predict_labels[j] == re_batch_labels[j] else 0 for j in range(batch_size)]\n",
    "        total_rewards += np.sum(rewards)\n",
    "    test_accuracy = total_rewards/1.0/test_size\n",
    "    return  test_accuracy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-10-18T03:26:23.481557Z",
     "start_time": "2018-10-18T03:26:23.472740Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def compute_accuracy_per_class(test_features, test_label, test_id, test_attributes):\n",
    "    \n",
    "    test_data = TensorDataset(test_features, test_label)\n",
    "    test_batch = 32\n",
    "    test_loader = DataLoader(test_data, batch_size=test_batch, shuffle=False)\n",
    "    total_rewards = 0\n",
    "    #print(test_features.size())\n",
    "    sample_labels = test_id\n",
    "    sample_attributes = test_attributes\n",
    "    class_num = sample_attributes.shape[0]\n",
    "    test_size = test_features.shape[0]\n",
    "    per_class_num = np.zeros(class_num)\n",
    "    per_class_true= np.zeros(class_num)\n",
    "\n",
    "    print(\"class num:\", class_num)\n",
    "\n",
    "    for batch_features,batch_labels in test_loader:\n",
    "\n",
    "        batch_size = batch_labels.shape[0]\n",
    "        batch_features_ext = torch.from_numpy(batch_features.numpy().repeat(class_num, 0))\n",
    "        batch_features_ext = (Variable(batch_features_ext).cuda(GPU).float())  # 32*1024\n",
    "\n",
    "\n",
    "        sample_features = (attribute_network(Variable(sample_attributes).cuda(GPU).float()))\n",
    "        sample_features_ext = sample_features.repeat(batch_size, 1)\n",
    "\n",
    "\n",
    "        relations = F.pairwise_distance(batch_features_ext, sample_features_ext, 2).view(-1, class_num)\n",
    "        re_batch_labels = []\n",
    "        for label in batch_labels.numpy():\n",
    "            index = np.argwhere(sample_labels == label)\n",
    "            re_batch_labels.append(index[0][0])\n",
    "        re_batch_labels_id, batch_per_num = np.unique(re_batch_labels , return_counts=True) \n",
    "        re_batch_labels = torch.cuda.LongTensor(re_batch_labels)\n",
    "        \n",
    "        for each in range(re_batch_labels_id.size):\n",
    "            #print(re_batch_labels_id[each])\n",
    "            #print(batch_per_num[each])\n",
    "            per_class_num[re_batch_labels_id[each]] = per_class_num[re_batch_labels_id[each]] + batch_per_num[each]\n",
    "        #print(re_batch_labels_id)\n",
    "        #print('-'*100)\n",
    "        #print(batch_per_num)\n",
    "        #print('-'*100)\n",
    "\n",
    "\n",
    "        _, predict_labels = torch.min(relations.data, 1)\n",
    "        for j in range(batch_size):\n",
    "            if predict_labels[j] == re_batch_labels[j]:\n",
    "                per_class_true[re_batch_labels[j]] = per_class_true[re_batch_labels[j]] + 1\n",
    "            \n",
    "    per_accuracy = per_class_true[np.nonzero(per_class_num)] / per_class_num[np.nonzero(per_class_num)]\n",
    "    \n",
    "\n",
    "    test_accuracy = np.sum(per_accuracy)/1.0/np.count_nonzero(per_class_num)\n",
    "   \n",
    "    #print(np.count_nonzero(per_class_num))\n",
    "    return  test_accuracy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "start_time": "2018-10-18T03:26:18.782Z"
    },
    "code_folding": [],
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "training...\n",
      "episode: 1 loss tensor(34.3253, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1\n",
      "gzsl: unseen=0.0000 , seen=0.0250 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 200 loss tensor(4.4217, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.18073751253510623\n",
      "gzsl: unseen=0.1793 , seen=0.0777 , h=0.1085\n",
      "____________________________________________________________________________________________________\n",
      "episode: 400 loss tensor(5.3671, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.316088207922689\n",
      "gzsl: unseen=0.3156 , seen=0.1523 , h=0.2055\n",
      "____________________________________________________________________________________________________\n",
      "episode: 600 loss tensor(3.6421, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14058108773523065\n",
      "gzsl: unseen=0.1406 , seen=0.0142 , h=0.0257\n",
      "____________________________________________________________________________________________________\n",
      "episode: 800 loss tensor(4.6057, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.32394128106815145\n",
      "gzsl: unseen=0.3236 , seen=0.0637 , h=0.1064\n",
      "____________________________________________________________________________________________________\n",
      "episode: 1000 loss tensor(3.0676, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.29982761090858706\n",
      "gzsl: unseen=0.2998 , seen=0.0175 , h=0.0331\n",
      "____________________________________________________________________________________________________\n",
      "episode: 1200 loss tensor(3.3773, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.18417271335907265\n",
      "gzsl: unseen=0.1840 , seen=0.0189 , h=0.0343\n",
      "____________________________________________________________________________________________________\n",
      "episode: 1400 loss tensor(3.3879, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.2400181679988132\n",
      "gzsl: unseen=0.2400 , seen=0.0318 , h=0.0561\n",
      "____________________________________________________________________________________________________\n",
      "episode: 1600 loss tensor(3.2717, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16834454514885405\n",
      "gzsl: unseen=0.1683 , seen=0.0386 , h=0.0628\n",
      "____________________________________________________________________________________________________\n",
      "episode: 1800 loss tensor(3.7077, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.2565704881500661\n",
      "gzsl: unseen=0.2562 , seen=0.0625 , h=0.1005\n",
      "____________________________________________________________________________________________________\n",
      "episode: 2000 loss tensor(3.7798, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.18658824155118964\n",
      "gzsl: unseen=0.1866 , seen=0.0230 , h=0.0410\n",
      "____________________________________________________________________________________________________\n",
      "episode: 2200 loss tensor(3.4773, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.23995334715434882\n",
      "gzsl: unseen=0.2400 , seen=0.0057 , h=0.0111\n",
      "____________________________________________________________________________________________________\n",
      "episode: 2400 loss tensor(4.1972, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.2627477469832239\n",
      "gzsl: unseen=0.2627 , seen=0.0206 , h=0.0382\n",
      "____________________________________________________________________________________________________\n",
      "episode: 2600 loss tensor(3.8973, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.2080900103656101\n",
      "gzsl: unseen=0.2081 , seen=0.0032 , h=0.0063\n",
      "____________________________________________________________________________________________________\n",
      "episode: 2800 loss tensor(2.7894, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11883611672933374\n",
      "gzsl: unseen=0.1188 , seen=0.0013 , h=0.0025\n",
      "____________________________________________________________________________________________________\n",
      "episode: 3000 loss tensor(4.1329, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.31813343013324025\n",
      "gzsl: unseen=0.3181 , seen=0.0157 , h=0.0299\n",
      "____________________________________________________________________________________________________\n",
      "episode: 3200 loss tensor(3.7690, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.26994889951813905\n",
      "gzsl: unseen=0.2698 , seen=0.0671 , h=0.1075\n",
      "____________________________________________________________________________________________________\n",
      "episode: 3400 loss tensor(3.3309, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1495583545246209\n",
      "gzsl: unseen=0.1496 , seen=0.0020 , h=0.0039\n",
      "____________________________________________________________________________________________________\n",
      "episode: 3600 loss tensor(3.3763, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12326089862094954\n",
      "gzsl: unseen=0.1233 , seen=0.0015 , h=0.0029\n",
      "____________________________________________________________________________________________________\n",
      "episode: 3800 loss tensor(4.2463, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.19406960344951796\n",
      "gzsl: unseen=0.1941 , seen=0.0062 , h=0.0119\n",
      "____________________________________________________________________________________________________\n",
      "episode: 4000 loss tensor(3.6970, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.24234552204781118\n",
      "gzsl: unseen=0.2423 , seen=0.0134 , h=0.0254\n",
      "____________________________________________________________________________________________________\n",
      "episode: 4200 loss tensor(4.5506, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1255019832113745\n",
      "gzsl: unseen=0.1255 , seen=0.0053 , h=0.0102\n",
      "____________________________________________________________________________________________________\n",
      "episode: 4400 loss tensor(4.3641, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.21179761081479415\n",
      "gzsl: unseen=0.2110 , seen=0.0427 , h=0.0710\n",
      "____________________________________________________________________________________________________\n",
      "episode: 4600 loss tensor(4.9527, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14718875213678792\n",
      "gzsl: unseen=0.1472 , seen=0.0266 , h=0.0450\n",
      "____________________________________________________________________________________________________\n",
      "episode: 4800 loss tensor(4.3610, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.21780288344275706\n",
      "gzsl: unseen=0.2176 , seen=0.0102 , h=0.0195\n",
      "____________________________________________________________________________________________________\n",
      "episode: 5000 loss tensor(3.6837, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10494928473605651\n",
      "gzsl: unseen=0.1049 , seen=0.0107 , h=0.0193\n",
      "____________________________________________________________________________________________________\n",
      "episode: 5200 loss tensor(3.7338, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11396102714970528\n",
      "gzsl: unseen=0.1140 , seen=0.0091 , h=0.0168\n",
      "____________________________________________________________________________________________________\n",
      "episode: 5400 loss tensor(4.2880, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15887362326014168\n",
      "gzsl: unseen=0.1589 , seen=0.0366 , h=0.0595\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 5600 loss tensor(3.9613, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.24049849928958206\n",
      "gzsl: unseen=0.2405 , seen=0.0183 , h=0.0341\n",
      "____________________________________________________________________________________________________\n",
      "episode: 5800 loss tensor(3.2175, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1106882095878123\n",
      "gzsl: unseen=0.1107 , seen=0.0029 , h=0.0057\n",
      "____________________________________________________________________________________________________\n",
      "episode: 6000 loss tensor(4.2592, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11344245715356208\n",
      "gzsl: unseen=0.1134 , seen=0.0055 , h=0.0105\n",
      "____________________________________________________________________________________________________\n",
      "episode: 6200 loss tensor(4.2039, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10638884028919449\n",
      "gzsl: unseen=0.1064 , seen=0.0115 , h=0.0208\n",
      "____________________________________________________________________________________________________\n",
      "episode: 6400 loss tensor(2.6431, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10128789986237882\n",
      "gzsl: unseen=0.1013 , seen=0.0018 , h=0.0035\n",
      "____________________________________________________________________________________________________\n",
      "episode: 6600 loss tensor(3.7038, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1552528610369943\n",
      "gzsl: unseen=0.1553 , seen=0.0073 , h=0.0140\n",
      "____________________________________________________________________________________________________\n",
      "episode: 6800 loss tensor(3.0498, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.19924834705773412\n",
      "gzsl: unseen=0.1992 , seen=0.0179 , h=0.0328\n",
      "____________________________________________________________________________________________________\n",
      "episode: 7000 loss tensor(3.3124, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.13621716509172158\n",
      "gzsl: unseen=0.1360 , seen=0.0087 , h=0.0164\n",
      "____________________________________________________________________________________________________\n",
      "episode: 7200 loss tensor(3.4293, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1049765855169488\n",
      "gzsl: unseen=0.1050 , seen=0.0019 , h=0.0037\n",
      "____________________________________________________________________________________________________\n",
      "episode: 7400 loss tensor(3.6479, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.23395487512813323\n",
      "gzsl: unseen=0.2340 , seen=0.0151 , h=0.0284\n",
      "____________________________________________________________________________________________________\n",
      "episode: 7600 loss tensor(3.3054, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10613254890270529\n",
      "gzsl: unseen=0.1061 , seen=0.0028 , h=0.0055\n",
      "____________________________________________________________________________________________________\n",
      "episode: 7800 loss tensor(3.5889, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12971758497887012\n",
      "gzsl: unseen=0.1297 , seen=0.0045 , h=0.0088\n",
      "____________________________________________________________________________________________________\n",
      "episode: 8000 loss tensor(3.6648, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15787823560432462\n",
      "gzsl: unseen=0.1579 , seen=0.0071 , h=0.0136\n",
      "____________________________________________________________________________________________________\n",
      "episode: 8200 loss tensor(3.4070, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14836982746681796\n",
      "gzsl: unseen=0.1484 , seen=0.0025 , h=0.0049\n",
      "____________________________________________________________________________________________________\n",
      "episode: 8400 loss tensor(3.5170, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1622120054732318\n",
      "gzsl: unseen=0.1622 , seen=0.0068 , h=0.0131\n",
      "____________________________________________________________________________________________________\n",
      "episode: 8600 loss tensor(3.6585, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1773950479876139\n",
      "gzsl: unseen=0.1774 , seen=0.0039 , h=0.0075\n",
      "____________________________________________________________________________________________________\n",
      "episode: 8800 loss tensor(3.9405, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12552988843631918\n",
      "gzsl: unseen=0.1242 , seen=0.0126 , h=0.0228\n",
      "____________________________________________________________________________________________________\n",
      "episode: 9000 loss tensor(3.0516, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.23066301213982973\n",
      "gzsl: unseen=0.2307 , seen=0.0129 , h=0.0244\n",
      "____________________________________________________________________________________________________\n",
      "episode: 9200 loss tensor(3.7667, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.23118365810705338\n",
      "gzsl: unseen=0.2309 , seen=0.0131 , h=0.0248\n",
      "____________________________________________________________________________________________________\n",
      "episode: 9400 loss tensor(4.4471, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.3405624389925347\n",
      "gzsl: unseen=0.3404 , seen=0.0148 , h=0.0283\n",
      "____________________________________________________________________________________________________\n",
      "episode: 9600 loss tensor(3.8295, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11558220419096318\n",
      "gzsl: unseen=0.1156 , seen=0.0068 , h=0.0129\n",
      "____________________________________________________________________________________________________\n",
      "episode: 9800 loss tensor(3.4709, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16917880059125875\n",
      "gzsl: unseen=0.1692 , seen=0.0044 , h=0.0085\n",
      "____________________________________________________________________________________________________\n",
      "episode: 10000 loss tensor(3.3767, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10542057678895203\n",
      "gzsl: unseen=0.1054 , seen=0.0046 , h=0.0089\n",
      "____________________________________________________________________________________________________\n",
      "episode: 10200 loss tensor(3.5082, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12831851564383623\n",
      "gzsl: unseen=0.1283 , seen=0.0017 , h=0.0033\n",
      "____________________________________________________________________________________________________\n",
      "episode: 10400 loss tensor(2.9160, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14421757435648214\n",
      "gzsl: unseen=0.1442 , seen=0.0016 , h=0.0032\n",
      "____________________________________________________________________________________________________\n",
      "episode: 10600 loss tensor(3.8450, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10123327649685725\n",
      "gzsl: unseen=0.1012 , seen=0.0011 , h=0.0021\n",
      "____________________________________________________________________________________________________\n",
      "episode: 10800 loss tensor(3.2957, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12674749483947242\n",
      "gzsl: unseen=0.1267 , seen=0.0016 , h=0.0032\n",
      "____________________________________________________________________________________________________\n",
      "episode: 11000 loss tensor(3.3138, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1380992630769055\n",
      "gzsl: unseen=0.1381 , seen=0.0011 , h=0.0021\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 11200 loss tensor(2.7111, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10958741293488723\n",
      "gzsl: unseen=0.1096 , seen=0.0002 , h=0.0004\n",
      "____________________________________________________________________________________________________\n",
      "episode: 11400 loss tensor(2.7578, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10437692762500658\n",
      "gzsl: unseen=0.1044 , seen=0.0008 , h=0.0017\n",
      "____________________________________________________________________________________________________\n",
      "episode: 11600 loss tensor(2.5513, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10954253560175106\n",
      "gzsl: unseen=0.1095 , seen=0.0008 , h=0.0016\n",
      "____________________________________________________________________________________________________\n",
      "episode: 11800 loss tensor(3.9131, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11659760346904295\n",
      "gzsl: unseen=0.1166 , seen=0.0020 , h=0.0039\n",
      "____________________________________________________________________________________________________\n",
      "episode: 12000 loss tensor(3.6438, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15553780288887178\n",
      "gzsl: unseen=0.1555 , seen=0.0013 , h=0.0025\n",
      "____________________________________________________________________________________________________\n",
      "episode: 12200 loss tensor(3.3244, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11460623198482064\n",
      "gzsl: unseen=0.1146 , seen=0.0014 , h=0.0027\n",
      "____________________________________________________________________________________________________\n",
      "episode: 12400 loss tensor(2.3551, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1086101826877504\n",
      "gzsl: unseen=0.1086 , seen=0.0015 , h=0.0029\n",
      "____________________________________________________________________________________________________\n",
      "episode: 12600 loss tensor(2.6712, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14897379568046346\n",
      "gzsl: unseen=0.1490 , seen=0.0013 , h=0.0025\n",
      "____________________________________________________________________________________________________\n",
      "episode: 12800 loss tensor(2.7096, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11725863890412354\n",
      "gzsl: unseen=0.1173 , seen=0.0009 , h=0.0018\n",
      "____________________________________________________________________________________________________\n",
      "episode: 13000 loss tensor(1.7606, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15235676243631643\n",
      "gzsl: unseen=0.1524 , seen=0.0012 , h=0.0025\n",
      "____________________________________________________________________________________________________\n",
      "episode: 13200 loss tensor(3.0810, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10523543529818251\n",
      "gzsl: unseen=0.1052 , seen=0.0008 , h=0.0015\n",
      "____________________________________________________________________________________________________\n",
      "episode: 13400 loss tensor(2.9511, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12212671575668213\n",
      "gzsl: unseen=0.1221 , seen=0.0009 , h=0.0018\n",
      "____________________________________________________________________________________________________\n",
      "episode: 13600 loss tensor(2.8612, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11170336530979523\n",
      "gzsl: unseen=0.1117 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 13800 loss tensor(3.4897, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12460237576683042\n",
      "gzsl: unseen=0.1246 , seen=0.0017 , h=0.0034\n",
      "____________________________________________________________________________________________________\n",
      "episode: 14000 loss tensor(2.9898, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1230180592244274\n",
      "gzsl: unseen=0.1230 , seen=0.0013 , h=0.0025\n",
      "____________________________________________________________________________________________________\n",
      "episode: 14200 loss tensor(2.8199, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14067278164256372\n",
      "gzsl: unseen=0.1407 , seen=0.0022 , h=0.0043\n",
      "____________________________________________________________________________________________________\n",
      "episode: 14400 loss tensor(2.5950, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10603626891965742\n",
      "gzsl: unseen=0.1060 , seen=0.0011 , h=0.0021\n",
      "____________________________________________________________________________________________________\n",
      "episode: 14600 loss tensor(3.5406, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10773323023911048\n",
      "gzsl: unseen=0.1077 , seen=0.0024 , h=0.0046\n",
      "____________________________________________________________________________________________________\n",
      "episode: 14800 loss tensor(2.6336, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17471522797722944\n",
      "gzsl: unseen=0.1747 , seen=0.0014 , h=0.0028\n",
      "____________________________________________________________________________________________________\n",
      "episode: 15000 loss tensor(1.8011, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1220787632282436\n",
      "gzsl: unseen=0.1221 , seen=0.0011 , h=0.0021\n",
      "____________________________________________________________________________________________________\n",
      "episode: 15200 loss tensor(3.0056, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1495793678199901\n",
      "gzsl: unseen=0.1496 , seen=0.0011 , h=0.0021\n",
      "____________________________________________________________________________________________________\n",
      "episode: 15400 loss tensor(3.3255, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.13022636063671683\n",
      "gzsl: unseen=0.1302 , seen=0.0006 , h=0.0012\n",
      "____________________________________________________________________________________________________\n",
      "episode: 15600 loss tensor(2.6857, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14703662689015443\n",
      "gzsl: unseen=0.1470 , seen=0.0011 , h=0.0021\n",
      "____________________________________________________________________________________________________\n",
      "episode: 15800 loss tensor(2.3632, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15132127047452973\n",
      "gzsl: unseen=0.1513 , seen=0.0006 , h=0.0012\n",
      "____________________________________________________________________________________________________\n",
      "episode: 16000 loss tensor(2.9742, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1759851732097891\n",
      "gzsl: unseen=0.1760 , seen=0.0016 , h=0.0031\n",
      "____________________________________________________________________________________________________\n",
      "episode: 16200 loss tensor(2.2214, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15140084912955615\n",
      "gzsl: unseen=0.1514 , seen=0.0011 , h=0.0021\n",
      "____________________________________________________________________________________________________\n",
      "episode: 16400 loss tensor(2.4432, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10877895130120066\n",
      "gzsl: unseen=0.1088 , seen=0.0013 , h=0.0025\n",
      "____________________________________________________________________________________________________\n",
      "episode: 16600 loss tensor(2.8417, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12383519661952311\n",
      "gzsl: unseen=0.1238 , seen=0.0013 , h=0.0026\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 16800 loss tensor(3.1848, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15580244928536213\n",
      "gzsl: unseen=0.1558 , seen=0.0007 , h=0.0015\n",
      "____________________________________________________________________________________________________\n",
      "episode: 17000 loss tensor(2.8723, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12315491778753522\n",
      "gzsl: unseen=0.1232 , seen=0.0004 , h=0.0008\n",
      "____________________________________________________________________________________________________\n",
      "episode: 17200 loss tensor(2.7009, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.130675058660957\n",
      "gzsl: unseen=0.1307 , seen=0.0005 , h=0.0010\n",
      "____________________________________________________________________________________________________\n",
      "episode: 17400 loss tensor(3.2150, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10869673372105096\n",
      "gzsl: unseen=0.1087 , seen=0.0007 , h=0.0014\n",
      "____________________________________________________________________________________________________\n",
      "episode: 17600 loss tensor(2.7084, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1804732755746116\n",
      "gzsl: unseen=0.1805 , seen=0.0013 , h=0.0026\n",
      "____________________________________________________________________________________________________\n",
      "episode: 17800 loss tensor(2.5980, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10744144400024327\n",
      "gzsl: unseen=0.1074 , seen=0.0002 , h=0.0004\n",
      "____________________________________________________________________________________________________\n",
      "episode: 18000 loss tensor(1.8049, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1007136227552774\n",
      "gzsl: unseen=0.1007 , seen=0.0004 , h=0.0008\n",
      "____________________________________________________________________________________________________\n",
      "episode: 18200 loss tensor(3.8957, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.100440906620244\n",
      "gzsl: unseen=0.1004 , seen=0.0003 , h=0.0006\n",
      "____________________________________________________________________________________________________\n",
      "episode: 18400 loss tensor(2.7534, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15228024898059406\n",
      "gzsl: unseen=0.1523 , seen=0.0015 , h=0.0030\n",
      "____________________________________________________________________________________________________\n",
      "episode: 18600 loss tensor(2.8275, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10443329229352907\n",
      "gzsl: unseen=0.1044 , seen=0.0015 , h=0.0030\n",
      "____________________________________________________________________________________________________\n",
      "episode: 18800 loss tensor(2.8701, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10105881972198569\n",
      "gzsl: unseen=0.1011 , seen=0.0007 , h=0.0014\n",
      "____________________________________________________________________________________________________\n",
      "episode: 19000 loss tensor(3.2049, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11826214602152789\n",
      "gzsl: unseen=0.1183 , seen=0.0015 , h=0.0029\n",
      "____________________________________________________________________________________________________\n",
      "episode: 19200 loss tensor(2.6010, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.23440005839938136\n",
      "gzsl: unseen=0.2344 , seen=0.0028 , h=0.0055\n",
      "____________________________________________________________________________________________________\n",
      "episode: 19400 loss tensor(2.4801, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10137057209473462\n",
      "gzsl: unseen=0.1014 , seen=0.0002 , h=0.0004\n",
      "____________________________________________________________________________________________________\n",
      "episode: 19600 loss tensor(2.4074, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.13618132347997544\n",
      "gzsl: unseen=0.1362 , seen=0.0008 , h=0.0015\n",
      "____________________________________________________________________________________________________\n",
      "episode: 19800 loss tensor(1.9921, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10632287429113622\n",
      "gzsl: unseen=0.1063 , seen=0.0004 , h=0.0008\n",
      "____________________________________________________________________________________________________\n",
      "episode: 20000 loss tensor(2.6914, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12479944433897254\n",
      "gzsl: unseen=0.1248 , seen=0.0005 , h=0.0010\n",
      "____________________________________________________________________________________________________\n",
      "episode: 20200 loss tensor(2.1562, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12467958432278115\n",
      "gzsl: unseen=0.1247 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 20400 loss tensor(2.3726, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1401824430837737\n",
      "gzsl: unseen=0.1402 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 20600 loss tensor(2.8887, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10501437115219012\n",
      "gzsl: unseen=0.1050 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 20800 loss tensor(3.1134, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11777926593152185\n",
      "gzsl: unseen=0.1178 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 21000 loss tensor(2.3933, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16909564059923382\n",
      "gzsl: unseen=0.1691 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 21200 loss tensor(2.7190, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.13139055668223718\n",
      "gzsl: unseen=0.1314 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 21400 loss tensor(2.6457, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17115228483780562\n",
      "gzsl: unseen=0.1712 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 21600 loss tensor(2.8023, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1452928466763215\n",
      "gzsl: unseen=0.1453 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 21800 loss tensor(2.1137, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12877225473864937\n",
      "gzsl: unseen=0.1288 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 22000 loss tensor(2.0571, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12868178236770414\n",
      "gzsl: unseen=0.1287 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 22200 loss tensor(1.6762, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11913507613025007\n",
      "gzsl: unseen=0.1191 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 22400 loss tensor(2.0094, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10720583613754815\n",
      "gzsl: unseen=0.1072 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 22600 loss tensor(2.8591, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15049088054458887\n",
      "gzsl: unseen=0.1505 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 22800 loss tensor(1.9124, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.131127979987309\n",
      "gzsl: unseen=0.1311 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 23000 loss tensor(2.2506, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10734966927053062\n",
      "gzsl: unseen=0.1073 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 23200 loss tensor(2.9113, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1025317506348706\n",
      "gzsl: unseen=0.1025 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 23400 loss tensor(2.7261, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1012449700832658\n",
      "gzsl: unseen=0.1012 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 23600 loss tensor(2.3794, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14240225001766768\n",
      "gzsl: unseen=0.1424 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 23800 loss tensor(2.1332, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11324633894807853\n",
      "gzsl: unseen=0.1132 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 24000 loss tensor(2.5976, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16540194055240415\n",
      "gzsl: unseen=0.1654 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 24200 loss tensor(2.3911, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.18083749990743167\n",
      "gzsl: unseen=0.1808 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 24400 loss tensor(2.1876, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17199611465140577\n",
      "gzsl: unseen=0.1720 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 24600 loss tensor(2.0710, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.138433268957115\n",
      "gzsl: unseen=0.1384 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 24800 loss tensor(2.1596, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.18160562269678587\n",
      "gzsl: unseen=0.1816 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 25000 loss tensor(2.6724, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1144147578242402\n",
      "gzsl: unseen=0.1144 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 25200 loss tensor(2.9918, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14171836507190222\n",
      "gzsl: unseen=0.1417 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 25400 loss tensor(2.2223, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1387352862977192\n",
      "gzsl: unseen=0.1387 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 25600 loss tensor(2.4383, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1230077204653051\n",
      "gzsl: unseen=0.1230 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 25800 loss tensor(2.8134, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12576483633388408\n",
      "gzsl: unseen=0.1258 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 26000 loss tensor(2.0329, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1615502426455449\n",
      "gzsl: unseen=0.1616 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 26200 loss tensor(2.1700, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11774372070968357\n",
      "gzsl: unseen=0.1177 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 26400 loss tensor(2.2684, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14205424354275206\n",
      "gzsl: unseen=0.1421 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 26600 loss tensor(3.0737, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11109505983590182\n",
      "gzsl: unseen=0.1111 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 26800 loss tensor(2.2360, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11115990111344073\n",
      "gzsl: unseen=0.1112 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 27000 loss tensor(2.6258, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11963813857193975\n",
      "gzsl: unseen=0.1196 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 27200 loss tensor(2.3240, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1013019959421511\n",
      "gzsl: unseen=0.1013 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 27400 loss tensor(2.6645, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.117844341680415\n",
      "gzsl: unseen=0.1178 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 27600 loss tensor(1.7784, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.10456474815253425\n",
      "gzsl: unseen=0.1046 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 27800 loss tensor(1.5086, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12431473427693837\n",
      "gzsl: unseen=0.1243 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 28000 loss tensor(2.1904, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11107318954928505\n",
      "gzsl: unseen=0.1111 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 28200 loss tensor(3.1088, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.13095612410990143\n",
      "gzsl: unseen=0.1310 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 28400 loss tensor(2.2897, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11453067967268593\n",
      "gzsl: unseen=0.1145 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 28600 loss tensor(2.0937, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16831889673015682\n",
      "gzsl: unseen=0.1683 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 28800 loss tensor(1.7789, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.13141365727594756\n",
      "gzsl: unseen=0.1314 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 29000 loss tensor(3.5433, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14526593514528935\n",
      "gzsl: unseen=0.1453 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 29200 loss tensor(1.7313, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1442967941563076\n",
      "gzsl: unseen=0.1443 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 29400 loss tensor(2.0452, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.13277559847843834\n",
      "gzsl: unseen=0.1328 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 29600 loss tensor(2.8046, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1304569804681843\n",
      "gzsl: unseen=0.1305 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 29800 loss tensor(2.1597, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15994231158643393\n",
      "gzsl: unseen=0.1599 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 30000 loss tensor(2.3224, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15250038724820686\n",
      "gzsl: unseen=0.1525 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 30200 loss tensor(1.6962, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15168466578252948\n",
      "gzsl: unseen=0.1517 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 30400 loss tensor(1.5330, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1086340575915252\n",
      "gzsl: unseen=0.1086 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 30600 loss tensor(1.9630, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.11708648898708832\n",
      "gzsl: unseen=0.1171 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 30800 loss tensor(2.5552, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.13139185078070253\n",
      "gzsl: unseen=0.1314 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 31000 loss tensor(2.1649, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.13438436948394444\n",
      "gzsl: unseen=0.1344 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 31200 loss tensor(2.4482, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15098329322343593\n",
      "gzsl: unseen=0.1510 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 31400 loss tensor(2.3614, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1488777489228746\n",
      "gzsl: unseen=0.1489 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 31600 loss tensor(2.4230, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15210847771555716\n",
      "gzsl: unseen=0.1521 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 31800 loss tensor(1.9593, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.13496615647623333\n",
      "gzsl: unseen=0.1350 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 32000 loss tensor(2.3580, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17159820076948434\n",
      "gzsl: unseen=0.1716 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 32200 loss tensor(2.5177, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1520667312803404\n",
      "gzsl: unseen=0.1521 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 32400 loss tensor(1.8418, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12433691670541183\n",
      "gzsl: unseen=0.1243 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 32600 loss tensor(2.1099, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15346043467609055\n",
      "gzsl: unseen=0.1535 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 32800 loss tensor(3.3225, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1657429322920023\n",
      "gzsl: unseen=0.1657 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 33000 loss tensor(2.1509, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14785574816390534\n",
      "gzsl: unseen=0.1479 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 33200 loss tensor(1.9057, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16489511952828928\n",
      "gzsl: unseen=0.1649 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 33400 loss tensor(1.3238, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1650159637488664\n",
      "gzsl: unseen=0.1650 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 33600 loss tensor(1.9924, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16542740976742887\n",
      "gzsl: unseen=0.1654 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 33800 loss tensor(1.7867, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16724849124954083\n",
      "gzsl: unseen=0.1672 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 34000 loss tensor(1.5222, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.12836134702862495\n",
      "gzsl: unseen=0.1284 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 34200 loss tensor(2.0090, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15447053354879822\n",
      "gzsl: unseen=0.1545 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 34400 loss tensor(2.8439, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16609246143817252\n",
      "gzsl: unseen=0.1661 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 34600 loss tensor(2.5733, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1715744370857469\n",
      "gzsl: unseen=0.1716 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 34800 loss tensor(2.1669, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16592470893529748\n",
      "gzsl: unseen=0.1659 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 35000 loss tensor(2.0223, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1656223639696974\n",
      "gzsl: unseen=0.1656 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 35200 loss tensor(1.7469, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16557058382712148\n",
      "gzsl: unseen=0.1656 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 35400 loss tensor(1.5284, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15343406307913496\n",
      "gzsl: unseen=0.1534 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 35600 loss tensor(1.9503, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15171013724006882\n",
      "gzsl: unseen=0.1517 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 35800 loss tensor(1.6028, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16629099234506542\n",
      "gzsl: unseen=0.1663 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 36000 loss tensor(1.6456, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14039658711282726\n",
      "gzsl: unseen=0.1404 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 36200 loss tensor(2.1280, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16370584362083168\n",
      "gzsl: unseen=0.1637 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 36400 loss tensor(1.9811, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1640647202312963\n",
      "gzsl: unseen=0.1641 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 36600 loss tensor(1.4332, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16490187293204603\n",
      "gzsl: unseen=0.1649 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 36800 loss tensor(1.8953, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16840692747482494\n",
      "gzsl: unseen=0.1684 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 37000 loss tensor(1.7592, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.13321678232995596\n",
      "gzsl: unseen=0.1332 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 37200 loss tensor(1.4436, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15278244753993336\n",
      "gzsl: unseen=0.1528 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 37400 loss tensor(2.2466, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1683185866469567\n",
      "gzsl: unseen=0.1683 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 37600 loss tensor(2.4988, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15548558012825509\n",
      "gzsl: unseen=0.1555 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 37800 loss tensor(2.1889, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15429399133253352\n",
      "gzsl: unseen=0.1543 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 38000 loss tensor(2.2612, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16078024308366906\n",
      "gzsl: unseen=0.1608 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 38200 loss tensor(2.0079, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16342640307572615\n",
      "gzsl: unseen=0.1634 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 38400 loss tensor(1.9808, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14505849950823763\n",
      "gzsl: unseen=0.1451 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 38600 loss tensor(2.0912, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16232375238123073\n",
      "gzsl: unseen=0.1623 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 38800 loss tensor(2.3091, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14638153324708872\n",
      "gzsl: unseen=0.1464 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 39000 loss tensor(1.7234, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17120144455278322\n",
      "gzsl: unseen=0.1712 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 39200 loss tensor(2.5605, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16348690666236265\n",
      "gzsl: unseen=0.1635 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 39400 loss tensor(2.0710, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16344725216081218\n",
      "gzsl: unseen=0.1634 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 39600 loss tensor(2.0147, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1547732151809696\n",
      "gzsl: unseen=0.1548 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 39800 loss tensor(1.5595, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.13019549892420787\n",
      "gzsl: unseen=0.1302 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 40000 loss tensor(2.0514, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14383503642617854\n",
      "gzsl: unseen=0.1438 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 40200 loss tensor(1.7825, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14465254591630367\n",
      "gzsl: unseen=0.1447 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 40400 loss tensor(2.0513, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16737152182672396\n",
      "gzsl: unseen=0.1674 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 40600 loss tensor(1.9047, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17126432096102245\n",
      "gzsl: unseen=0.1713 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 40800 loss tensor(1.6470, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1537326022934308\n",
      "gzsl: unseen=0.1537 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 41000 loss tensor(2.4326, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.168362078726517\n",
      "gzsl: unseen=0.1684 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 41200 loss tensor(1.5526, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16790272394390143\n",
      "gzsl: unseen=0.1679 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 41400 loss tensor(2.3043, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16453010067135712\n",
      "gzsl: unseen=0.1645 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 41600 loss tensor(2.3287, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15598139162221836\n",
      "gzsl: unseen=0.1560 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 41800 loss tensor(2.5369, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.14954422326718705\n",
      "gzsl: unseen=0.1495 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 42000 loss tensor(1.9796, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15411217315071535\n",
      "gzsl: unseen=0.1541 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 42200 loss tensor(2.2013, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16210637608999964\n",
      "gzsl: unseen=0.1621 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 42400 loss tensor(1.6587, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16164504836624136\n",
      "gzsl: unseen=0.1616 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 42600 loss tensor(1.2596, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15964535080049744\n",
      "gzsl: unseen=0.1596 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 42800 loss tensor(3.5080, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16856460819191224\n",
      "gzsl: unseen=0.1686 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 43000 loss tensor(2.5861, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16838306710100312\n",
      "gzsl: unseen=0.1684 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 43200 loss tensor(1.9801, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1715713814941025\n",
      "gzsl: unseen=0.1716 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 43400 loss tensor(2.0472, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16103895266127177\n",
      "gzsl: unseen=0.1610 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 43600 loss tensor(1.6804, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16819864642382887\n",
      "gzsl: unseen=0.1682 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 43800 loss tensor(1.8092, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16954824456683365\n",
      "gzsl: unseen=0.1695 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 44000 loss tensor(2.2785, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16809911179863185\n",
      "gzsl: unseen=0.1681 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 44200 loss tensor(2.1232, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16689906011623734\n",
      "gzsl: unseen=0.1669 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 44400 loss tensor(2.7499, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16423481707774937\n",
      "gzsl: unseen=0.1642 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 44600 loss tensor(1.7827, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16713469347916343\n",
      "gzsl: unseen=0.1671 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 44800 loss tensor(1.9507, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1673180140482883\n",
      "gzsl: unseen=0.1673 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 45000 loss tensor(1.9211, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16787048608361715\n",
      "gzsl: unseen=0.1679 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 45200 loss tensor(2.0725, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16716408098842628\n",
      "gzsl: unseen=0.1672 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 45400 loss tensor(2.3226, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16838975265308018\n",
      "gzsl: unseen=0.1684 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 45600 loss tensor(1.7454, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16767013719928942\n",
      "gzsl: unseen=0.1677 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 45800 loss tensor(2.5453, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15964194681247762\n",
      "gzsl: unseen=0.1596 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 46000 loss tensor(2.3381, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16436753943003843\n",
      "gzsl: unseen=0.1644 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 46200 loss tensor(1.2269, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16864849651870487\n",
      "gzsl: unseen=0.1686 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 46400 loss tensor(1.4364, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16839722146070665\n",
      "gzsl: unseen=0.1684 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 46600 loss tensor(2.0477, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16948565906141747\n",
      "gzsl: unseen=0.1695 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 46800 loss tensor(1.2342, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16206029039774367\n",
      "gzsl: unseen=0.1621 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 47000 loss tensor(2.4601, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16973454059307447\n",
      "gzsl: unseen=0.1697 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 47200 loss tensor(2.2274, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16485461268999263\n",
      "gzsl: unseen=0.1649 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 47400 loss tensor(1.9129, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1682359484277046\n",
      "gzsl: unseen=0.1682 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 47600 loss tensor(1.7730, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17032179813715548\n",
      "gzsl: unseen=0.1703 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 47800 loss tensor(1.3816, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15998937833220117\n",
      "gzsl: unseen=0.1600 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 48000 loss tensor(1.5577, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1667235425121021\n",
      "gzsl: unseen=0.1667 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 48200 loss tensor(1.4311, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17125517545018015\n",
      "gzsl: unseen=0.1713 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 48400 loss tensor(3.2480, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17091236132626897\n",
      "gzsl: unseen=0.1709 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 48600 loss tensor(1.6512, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1749045979415303\n",
      "gzsl: unseen=0.1749 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 48800 loss tensor(2.1228, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17010519901655824\n",
      "gzsl: unseen=0.1701 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 49000 loss tensor(2.1694, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17166933119185485\n",
      "gzsl: unseen=0.1717 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 49200 loss tensor(1.7248, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17589530222280558\n",
      "gzsl: unseen=0.1759 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 49400 loss tensor(2.4688, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1713665667779864\n",
      "gzsl: unseen=0.1714 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 49600 loss tensor(1.6664, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17435938619896282\n",
      "gzsl: unseen=0.1744 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 49800 loss tensor(1.7138, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1744153894037993\n",
      "gzsl: unseen=0.1744 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 50000 loss tensor(1.2226, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17386051056712323\n",
      "gzsl: unseen=0.1739 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 50200 loss tensor(2.5854, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17346475756210425\n",
      "gzsl: unseen=0.1735 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 50400 loss tensor(2.2622, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17078583801668704\n",
      "gzsl: unseen=0.1708 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 50600 loss tensor(1.2503, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17070682885638025\n",
      "gzsl: unseen=0.1707 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 50800 loss tensor(2.1405, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17031515584012297\n",
      "gzsl: unseen=0.1703 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 51000 loss tensor(2.8019, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1683228576643804\n",
      "gzsl: unseen=0.1683 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 51200 loss tensor(1.8939, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16550036548797462\n",
      "gzsl: unseen=0.1655 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 51400 loss tensor(1.6377, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17011713323518257\n",
      "gzsl: unseen=0.1701 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 51600 loss tensor(2.1087, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16855573347917657\n",
      "gzsl: unseen=0.1686 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 51800 loss tensor(2.0108, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16224450081017208\n",
      "gzsl: unseen=0.1622 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 52000 loss tensor(2.7624, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1691196171588057\n",
      "gzsl: unseen=0.1691 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 52200 loss tensor(1.3369, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16529509376132587\n",
      "gzsl: unseen=0.1653 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 52400 loss tensor(1.5903, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1640505822192619\n",
      "gzsl: unseen=0.1641 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 52600 loss tensor(1.8867, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16203934305192397\n",
      "gzsl: unseen=0.1620 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 52800 loss tensor(1.5318, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16303207337134945\n",
      "gzsl: unseen=0.1630 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 53000 loss tensor(1.7360, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16683319978740846\n",
      "gzsl: unseen=0.1668 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 53200 loss tensor(1.9046, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16233057829762332\n",
      "gzsl: unseen=0.1623 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 53400 loss tensor(1.3034, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1646938185221203\n",
      "gzsl: unseen=0.1647 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 53600 loss tensor(2.1641, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16237481937336645\n",
      "gzsl: unseen=0.1624 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 53800 loss tensor(1.8288, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16879308584266442\n",
      "gzsl: unseen=0.1688 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 54000 loss tensor(1.9726, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16814540595004615\n",
      "gzsl: unseen=0.1681 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 54200 loss tensor(1.9304, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16993534976217695\n",
      "gzsl: unseen=0.1699 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 54400 loss tensor(1.7768, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16898192608433002\n",
      "gzsl: unseen=0.1690 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 54600 loss tensor(1.7986, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1701705719610769\n",
      "gzsl: unseen=0.1702 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 54800 loss tensor(2.0073, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16556775333294957\n",
      "gzsl: unseen=0.1656 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 55000 loss tensor(2.3096, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1705667802601069\n",
      "gzsl: unseen=0.1706 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 55200 loss tensor(2.7436, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17029400714087323\n",
      "gzsl: unseen=0.1703 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 55400 loss tensor(2.0163, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17020071566131684\n",
      "gzsl: unseen=0.1702 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 55600 loss tensor(1.5406, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1676047037484614\n",
      "gzsl: unseen=0.1676 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 55800 loss tensor(1.9584, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1707723920166351\n",
      "gzsl: unseen=0.1708 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 56000 loss tensor(2.0326, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1654559774515398\n",
      "gzsl: unseen=0.1655 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 56200 loss tensor(1.5651, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1655144170169714\n",
      "gzsl: unseen=0.1655 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 56400 loss tensor(2.0339, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15897477870630183\n",
      "gzsl: unseen=0.1590 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 56600 loss tensor(2.2429, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1631351861562071\n",
      "gzsl: unseen=0.1631 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 56800 loss tensor(1.4783, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16088579888070034\n",
      "gzsl: unseen=0.1609 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 57000 loss tensor(1.4584, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.15901701255288025\n",
      "gzsl: unseen=0.1590 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 57200 loss tensor(2.3623, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1570870754121549\n",
      "gzsl: unseen=0.1571 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 57400 loss tensor(1.7927, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16308805300506724\n",
      "gzsl: unseen=0.1631 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 57600 loss tensor(2.7362, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16179002477325177\n",
      "gzsl: unseen=0.1618 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 57800 loss tensor(1.8886, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1667263690570666\n",
      "gzsl: unseen=0.1667 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 58000 loss tensor(1.9963, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16484302151350028\n",
      "gzsl: unseen=0.1648 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 58200 loss tensor(2.1561, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17399072889107275\n",
      "gzsl: unseen=0.1740 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 58400 loss tensor(1.6748, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16832717958108884\n",
      "gzsl: unseen=0.1683 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 58600 loss tensor(2.2749, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.164866292968036\n",
      "gzsl: unseen=0.1649 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 58800 loss tensor(1.8895, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16484785182122716\n",
      "gzsl: unseen=0.1648 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 59000 loss tensor(2.0534, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16797576701611744\n",
      "gzsl: unseen=0.1680 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 59200 loss tensor(2.4768, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16952499953686823\n",
      "gzsl: unseen=0.1695 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 59400 loss tensor(1.4463, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17067856727921055\n",
      "gzsl: unseen=0.1707 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 59600 loss tensor(1.8057, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17135924011321152\n",
      "gzsl: unseen=0.1714 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 59800 loss tensor(2.3362, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1653884199496949\n",
      "gzsl: unseen=0.1654 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 60000 loss tensor(1.8621, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17099787346555279\n",
      "gzsl: unseen=0.1710 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 60200 loss tensor(2.1712, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17104221607627176\n",
      "gzsl: unseen=0.1710 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 60400 loss tensor(1.7196, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16716425566941917\n",
      "gzsl: unseen=0.1672 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 60600 loss tensor(2.4117, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16724356202535143\n",
      "gzsl: unseen=0.1672 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 60800 loss tensor(1.6684, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16588714991657377\n",
      "gzsl: unseen=0.1659 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 61000 loss tensor(1.4444, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1663815815378629\n",
      "gzsl: unseen=0.1664 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 61200 loss tensor(1.6648, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1681385114289542\n",
      "gzsl: unseen=0.1681 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 61400 loss tensor(1.1211, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16624157749236507\n",
      "gzsl: unseen=0.1662 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 61600 loss tensor(2.0240, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16602227780783824\n",
      "gzsl: unseen=0.1660 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 61800 loss tensor(1.8566, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1690985348649286\n",
      "gzsl: unseen=0.1691 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 62000 loss tensor(1.2670, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1712658136855977\n",
      "gzsl: unseen=0.1713 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 62200 loss tensor(1.7359, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16694739276627807\n",
      "gzsl: unseen=0.1669 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 62400 loss tensor(1.0730, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17045494739449688\n",
      "gzsl: unseen=0.1705 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 62600 loss tensor(1.4010, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16749040923461594\n",
      "gzsl: unseen=0.1675 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 62800 loss tensor(1.2291, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16459595922164988\n",
      "gzsl: unseen=0.1646 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 63000 loss tensor(2.3641, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16094168682140522\n",
      "gzsl: unseen=0.1609 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 63200 loss tensor(2.7899, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16047550434386096\n",
      "gzsl: unseen=0.1605 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 63400 loss tensor(2.2851, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16327471392803714\n",
      "gzsl: unseen=0.1633 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 63600 loss tensor(1.6575, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16457264192060775\n",
      "gzsl: unseen=0.1646 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 63800 loss tensor(2.3422, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1701822089840757\n",
      "gzsl: unseen=0.1702 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 64000 loss tensor(1.6213, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16149387736877557\n",
      "gzsl: unseen=0.1615 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 64200 loss tensor(2.9609, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16837377947436058\n",
      "gzsl: unseen=0.1684 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 64400 loss tensor(1.6040, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16812431251847518\n",
      "gzsl: unseen=0.1681 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 64600 loss tensor(3.0249, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16513660443903433\n",
      "gzsl: unseen=0.1651 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 64800 loss tensor(2.1440, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16987695562246122\n",
      "gzsl: unseen=0.1699 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 65000 loss tensor(1.5414, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16974181659350285\n",
      "gzsl: unseen=0.1697 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 65200 loss tensor(2.4678, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16512497984946034\n",
      "gzsl: unseen=0.1651 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 65400 loss tensor(1.4225, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16409289574621894\n",
      "gzsl: unseen=0.1641 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 65600 loss tensor(2.0417, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1618342534155701\n",
      "gzsl: unseen=0.1618 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 65800 loss tensor(1.6150, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1636826033800509\n",
      "gzsl: unseen=0.1637 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 66000 loss tensor(2.4791, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.162393794198834\n",
      "gzsl: unseen=0.1624 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 66200 loss tensor(1.7158, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16438167151435423\n",
      "gzsl: unseen=0.1644 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 66400 loss tensor(2.0407, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16508071649832948\n",
      "gzsl: unseen=0.1651 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 66600 loss tensor(1.5396, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16127035859824707\n",
      "gzsl: unseen=0.1613 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 66800 loss tensor(1.4352, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16348657427511942\n",
      "gzsl: unseen=0.1635 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 67000 loss tensor(2.2317, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16140541878840797\n",
      "gzsl: unseen=0.1614 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 67200 loss tensor(1.4994, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16183662466652354\n",
      "gzsl: unseen=0.1618 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 67400 loss tensor(1.6262, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16669370714518156\n",
      "gzsl: unseen=0.1667 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 67600 loss tensor(1.1713, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16179239472847426\n",
      "gzsl: unseen=0.1618 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 67800 loss tensor(2.1869, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16444676866369476\n",
      "gzsl: unseen=0.1644 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 68000 loss tensor(2.8039, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16198346754464393\n",
      "gzsl: unseen=0.1620 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 68200 loss tensor(1.1603, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1595085975244885\n",
      "gzsl: unseen=0.1595 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 68400 loss tensor(1.9314, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.166034003932388\n",
      "gzsl: unseen=0.1660 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 68600 loss tensor(2.1100, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1654093664205742\n",
      "gzsl: unseen=0.1654 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 68800 loss tensor(1.7538, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16440253872564548\n",
      "gzsl: unseen=0.1644 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 69000 loss tensor(1.4700, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17065529582467484\n",
      "gzsl: unseen=0.1707 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 69200 loss tensor(1.5807, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16766059168916628\n",
      "gzsl: unseen=0.1677 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 69400 loss tensor(2.1016, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17066694398536753\n",
      "gzsl: unseen=0.1707 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 69600 loss tensor(1.9596, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17021972477480632\n",
      "gzsl: unseen=0.1702 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 69800 loss tensor(1.8633, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16597568905226034\n",
      "gzsl: unseen=0.1660 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 70000 loss tensor(1.2942, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1650364531471986\n",
      "gzsl: unseen=0.1650 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 70200 loss tensor(2.3573, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16548857166232123\n",
      "gzsl: unseen=0.1655 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 70400 loss tensor(1.3573, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16528344731715475\n",
      "gzsl: unseen=0.1653 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 70600 loss tensor(2.0613, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16631361458851335\n",
      "gzsl: unseen=0.1663 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 70800 loss tensor(1.5972, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16963005184978697\n",
      "gzsl: unseen=0.1696 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 71000 loss tensor(1.8809, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.17036409528778806\n",
      "gzsl: unseen=0.1704 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 71200 loss tensor(2.0138, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16522757051414377\n",
      "gzsl: unseen=0.1652 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 71400 loss tensor(1.8030, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16519493175258687\n",
      "gzsl: unseen=0.1652 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 71600 loss tensor(1.4704, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16836214374709274\n",
      "gzsl: unseen=0.1684 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 71800 loss tensor(2.1232, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16542099101014818\n",
      "gzsl: unseen=0.1654 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 72000 loss tensor(1.8188, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16769325402184188\n",
      "gzsl: unseen=0.1677 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 72200 loss tensor(1.8093, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16522760392722535\n",
      "gzsl: unseen=0.1652 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 72400 loss tensor(2.1147, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16539766257141214\n",
      "gzsl: unseen=0.1654 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 72600 loss tensor(2.0555, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.16724114664441309\n",
      "gzsl: unseen=0.1672 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 72800 loss tensor(2.2080, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.1663626649923266\n",
      "gzsl: unseen=0.1664 , seen=0.0000 , h=0.0000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 73000 loss tensor(1.9077, device='cuda:0')\n",
      "loss_zero_number=  0\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n"
     ]
    }
   ],
   "source": [
    "print(\"training...\")\n",
    "last_accuracy = 0.0\n",
    "loss_zero_num =0\n",
    "#writer = SummaryWriter()\n",
    "#vis = visdom.Visdom()\n",
    "for episode in range(EPISODE):\n",
    "\n",
    "    attribute_network_scheduler.step(episode)\n",
    "    metric_network_scheduler.step(episode)\n",
    "\n",
    "    train_loader = DataLoader(train_data, batch_size=BATCH_SIZE, shuffle=True)\n",
    "\n",
    "    batch_labels, batch_features = train_loader.__iter__().next()\n",
    "    batch_id = np.unique(batch_labels)\n",
    "\n",
    "    batch_attributes = torch.Tensor([all_attributes[i] for i in batch_id]).squeeze(1)\n",
    "    batch_features_ext = torch.from_numpy(batch_features.numpy().repeat(batch_id.size, 0))\n",
    "    batch_attributes_ext = batch_attributes.repeat(BATCH_SIZE, 1)\n",
    "\n",
    "    batch_features_ext = Variable(batch_features_ext).cuda(GPU).float()  # 32*2048\n",
    "    batch_attributes_ext = Variable(batch_attributes_ext).cuda(GPU)\n",
    "\n",
    "\n",
    "    re_batch_labels = []\n",
    "    for label in batch_labels.numpy():\n",
    "        index = np.argwhere(batch_id == label)\n",
    "        re_batch_labels.append(index[0][0])\n",
    "    re_batch_labels = torch.cuda.LongTensor(re_batch_labels)\n",
    "    re_batch_labels = Variable(re_batch_labels).cuda(GPU)\n",
    "    \n",
    "\n",
    "    criterion = HardTripletLoss_D(margin = Margin).cuda(GPU)\n",
    "    triplet_loss= criterion((attribute_network(batch_attributes_ext)), \n",
    "                            (batch_features_ext), re_batch_labels)\n",
    "    if triplet_loss == 0:\n",
    "        loss_zero_num = loss_zero_num + 1\n",
    "    \n",
    "    \n",
    "    attribute_network.zero_grad()\n",
    "    metric_network.zero_grad()\n",
    "    \n",
    "    triplet_loss.backward()\n",
    "    \n",
    "    attribute_network_optim.step()\n",
    "    metric_network_optim.step()\n",
    "\n",
    "    \n",
    "    if (episode+1)%200 == 0 or episode==0:\n",
    "        print(\"episode:\", episode+1, \"loss\", triplet_loss)\n",
    "        print('loss_zero_number= ',loss_zero_num)\n",
    "        loss_zero_num = 0\n",
    "        #writer.add_scalar('data/loss', triplet_loss, episode)\n",
    "    \n",
    "    if (episode+1)%200 == 0 or episode==0:\n",
    "        print(\"Testing...\")\n",
    "        #attribute_network.eval()\n",
    "        zsl_accuracy = compute_accuracy_per_class(test_features, test_label, test_id, test_attributes)\n",
    "        gzsl_unseen_accuracy = compute_accuracy_per_class(test_features, test_label, np.arange(50), attributes)\n",
    "        gzsl_seen_accuracy = compute_accuracy_per_class(test_seen_features, test_seen_label, np.arange(50), attributes)\n",
    "        H = 2 * gzsl_seen_accuracy * gzsl_unseen_accuracy / (gzsl_unseen_accuracy + gzsl_seen_accuracy)\n",
    "        #H2 = 2 * gzsl_seen_accuracy2 * gzsl_unseen_accuracy2 / (gzsl_unseen_accuracy2 + gzsl_seen_accuracy2)\n",
    "        print('zsl:', zsl_accuracy)\n",
    "        #print('zsl:', zsl_accuracy2)\n",
    "        print('gzsl: unseen=%.4f , seen=%.4f , h=%.4f' % (gzsl_unseen_accuracy , gzsl_seen_accuracy, H))\n",
    "        #print('gzsl: unseen=%.4f , seen=%.4f , h=%.4f' % (gzsl_unseen_accuracy2 , gzsl_seen_accuracy2, H2))\n",
    "        print('_'*100)\n",
    "        #writer.add_scalar('data/zsl_accuracy', zsl_accuracy, episode)\n",
    "        #writer.add_scalar('data/gzsl_unseen_accuracy', gzsl_unseen_accuracy, episode)\n",
    "        #writer.add_scalar('data/gzsl_seen_accuracy', gzsl_seen_accuracy, episode)\n",
    "        #writer.add_scalar('data/H', H, episode)\n",
    "#features = images.view(, 784)\n",
    "#print(vis_label.size())\n",
    "#writer.add_embedding(vis_images, metadata = vis_label.tolist())\n",
    "#writer.add_embedding(vis_att, metadata = vis_label_att)\n",
    "#writer.export_scalars_to_json(\"./test.json\")\n",
    "#writer.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "hide_input": false,
  "kernelspec": {
   "display_name": "pytorch",
   "language": "python",
   "name": "pytorch"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
